<!-- NewTrain_win.html -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/html-base.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/public-train.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/train.css"/>
    <style type="text/css">
    	body{
    		height: auto;
    	}
    </style>
    <script type="text/javascript" src="../../script/jquery.min.js"></script>
    <script type="text/javascript" src="../../script/newresize.js"></script>
</head>
<body id="body">
	<header class="header">
		<ul class="navlevel1">
			<li id="tag1" t_index="1" class="active f-tag"><span>培训班</span></li>
			<li id="tag2" t_index="2" class="f-tag"><span>线上课程</span></li>
		</ul>
	</header>
	<div class="allcontainer">
		<div class="navcontainer">
			<ul class="navwrapper">
				<li id="subtag1" t_index="1" class="active sub-tag"><a href="javascript:;">师资培训</a></li>
				<li id="subtag2" t_index="2" class="sub-tag"><a href="javascript:;">双创培训</a></li>
				<li id="subtag3" t_index="3" class="sub-tag"><a href="javascript:;">前沿培训</a></li>
				<li id="subtag4" t_index="4" class="sub-tag"><a href="javascript:;">实践教学</a></li>
			</ul>
		</div>
	</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/mui.min.js"></script>
<script type="text/javascript" src="../../script/MD5.js"></script>
<script type="text/javascript" src="../../script/requestTool.js"></script>
<script type="text/javascript" src="../../script/timeStampTool.js"></script>
<script type="text/javascript">
	var tagIndex = 1;//默认选中1
	var subTagIndex = 1;
	function selectTag(index){
		switch(index){
			case 0:
			setupTag($('#tag1'), $('#subtag1'))
			break;
			case 1:
			setupTag($('#tag1'), $('#subtag2'))
			break;
			case 2:
			setupTag($('#tag1'), $('#subtag3'))
			break;
			case 3:
			setupTag($('#tag1'), $('#subtag4'))
			break;
			case 4:
			setupTag($('#tag2'), $('#subtag1'))
			break;
			case 5:
			setupTag($('#tag2'), $('#subtag2'))
			break;
			case 6:
			setupTag($('#tag2'), $('#subtag3'))
			break;
			case 7:
			setupTag($('#tag2'), $('#subtag4'))
			break;
		}
	}
	function setupTag(f_tag, s_tag){
		$(".f-tag").removeClass("active");
		$(".sub-tag").removeClass("active");
		f_tag.addClass('active');
		s_tag.addClass('active');
	}
	function selectGroupIndex(){
		var groupIndex = 0;
		switch(tagIndex){
			case 1:{
				switch(subTagIndex){
					case 1:{
						groupIndex = 0;
					}break;
					case 2:{
						groupIndex = 1;
					}break;
					case 3:{
						groupIndex = 2;
					}break;
					case 4:{
						groupIndex = 3;
					}break;
				}
			}break;
			case 2:{
				switch(subTagIndex){
					case 1:{
						groupIndex = 4;
					}break;
					case 2:{
						groupIndex = 5;
					}break;
					case 3:{
						groupIndex = 6;
					}break;
					case 4:{
						groupIndex = 7;
					}break;
				}
			}
		}
		api.setFrameGroupIndex({
		    name: 'NewTrain_winFrameGroup',
		    index: groupIndex,
		    scroll: true
		});
	}
	apiready = function(){
	    setupFrameGroup();
	    prepareData();
	}
	function prepareData(){
		$(".f-tag").on("click",function(){
			$(".f-tag").removeClass("active");
			$(this).addClass("active");
			tagIndex = parseInt($(this).attr('t_index'));
			selectGroupIndex();
		})
		$(".sub-tag").on("click",function(){
			$(".sub-tag").removeClass("active");
			$(this).addClass("active");
			subTagIndex = parseInt($(this).attr('t_index'));
			selectGroupIndex();
		})
	}
	function setupFrameGroup(){
		var y = $('#body').height();
		var h = api.winHeight - y - 52;
		api.openFrameGroup({
		    name: 'NewTrain_winFrameGroup',
		    rect: {
		         x: 0, 
		         y: y, 
		         w: 'auto',
		         h: h
		    },
		    scrollEnabled: true,
		    frames: [{
		        name: 'NewTrain_frame1', 
		        url: 'NewTrain_frame.html',
		        bounces: false,
		        pageParam: {
		        	train_type : 1,
		        	isBuied : false
		        }
		    },{
		        name: 'NewTrain_frame2', 
		        url: 'NewTrain_frame.html',
		        bounces: false,
		        pageParam: {
		        	train_type : 2,
		        	isBuied : false
		        }
		    },{
		        name: 'NewTrain_frame3', 
		        url: 'NewTrain_frame.html',
		        bounces: false,
		        pageParam: {
		        	train_type : 3,
		        	isBuied : false
		        }
		    },{
		        name: 'NewTrain_frame4', 
		        url: 'NewTrain_frame.html',
		        bounces: false,
		        pageParam: {
		        	train_type : 4,
		        	isBuied : false
		        }
		    },{
		        name: 'NewTrainCourse_frame1', 
		        url: 'NewTrainCourse_frame.html',
		        bounces: false,
		        pageParam: {
		        	train_type : 1,
		        	isBuied : false
		        }
		    },{
		        name: 'NewTrainCourse_frame2', 
		        url: 'NewTrainCourse_frame.html',
		        bounces: false,
		        pageParam: {
		        	train_type : 2,
		        	isBuied : false
		        }
		    },{
		        name: 'NewTrainCourse_frame3', 
		        url: 'NewTrainCourse_frame.html',
		        bounces: false,
		        pageParam: {
		        	train_type : 3,
		        	isBuied : false
		        }
		    },{
		        name: 'NewTrainCourse_frame4', 
		        url: 'NewTrainCourse_frame.html',
		        bounces: false,
		        pageParam: {
		        	train_type : 4,
		        	isBuied : false
		        }
		    }]
		}, function(ret, err) {
		    var index = ret.index;
		   	selectTag(index);
		});
		api.setFrameGroupAttr({
		    name: 'NewTrain_winFrameGroup',
		    hidden: true
		});
	}
</script>
</html>
